﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Common;
using System.Data.SqlClient;
using JM.JCY.BusinessEntity;
using JM.JCY.Common;
using System.Data;
using JM.JCY.BusinessEntity.DSJCYD94;
using JM.JCY.BusinessEntity.DSJCYD94.T_SJ_AJXXDataSetTableAdapters;
using JM.JCY.BusinessEntity.DSJCYD94.T_ZZ_AJXXDataSetTableAdapters;
using JM.JCY.BusinessEntity.DSJCYD94.T_MX_AJXXDataSetTableAdapters;
using JM.JCY.BusinessEntity.DSJCYD94.T_DMDataSetTableAdapters;
using JM.JCY.BusinessEntity.DSJCYD94.T_FJ_AJXXDataSetTableAdapters;
using JM.JCY.BusinessEntity.DSJCYD94.T_RMJDY_JDAJXXDataSetTableAdapters;
using JM.JCY.BusinessEntity.DSJCYD94.T_XSGL_JBXSXXDataSetTableAdapters;
using JM.JCY.BusinessEntity.DSJCYD94.T_JDBDataSetTableAdapters;
using JM.JCY.BusinessEntity.DSJCYD94.T_PB_AJXXDataSetTableAdapters;
using JM.JCY.BusinessEntity.DSJCYD94.T_KS_JBXSXXDataSetTableAdapters;
using JM.JCY.BusinessEntity.DSJCYD94.T_AJBSGXDataSetTableAdapters;
using JM.JCY.BusinessEntity.DSJCYD94.T_AJGL_AJJK_YJAJDataSetTableAdapters;
using JM.JCY.BusinessEntity.DSJCYD94.T_AJGL_AJCXDataSetTableAdapters;
using JM.JCY.BusinessEntity.DSJCYD94.CaseManagementDataSetTableAdapters;


namespace JM.JCY.DataAccess
{
    public class DSJCYD94DA : JCYDataAccessBasecs
    {
        public T_SJ_AJXXDataSet.T_SJ_AJXXDataTable GetAJXXByUserName(string userName)
        {
            var AJXXDT = new T_SJ_AJXXDataSet.T_SJ_AJXXDataTable();
            var ad = new T_SJ_AJXXTableAdapter();
            AJXXDT = ad.GetDataByCBR(userName);
            return AJXXDT;
          
        }

        public T_SJ_AJXXDataSet.T_SJ_AJXXDataTable GetAJXX(string userName,string startDate,string endDate)
        {
            var AJXXDT = new T_SJ_AJXXDataSet.T_SJ_AJXXDataTable();
            var ad = new T_SJ_AJXXTableAdapter();
            AJXXDT = ad.GetSJData(userName, startDate, endDate);
            return AJXXDT;

        }

        public T_SJ_AJXXDataSet.T_SJ_AJXXDataTable GetAJXXByBH(decimal BH)
        {
            var AJXXDT = new T_SJ_AJXXDataSet.T_SJ_AJXXDataTable();
            var ad = new T_SJ_AJXXTableAdapter();
            AJXXDT = ad.GetAJXXDataByBH(BH);
            return AJXXDT;

        }

        public T_SJ_AJXXDataSet.T_SJ_XYRDataTable GetXYRByBH(decimal BH)
        {
            var XYRDT = new T_SJ_AJXXDataSet.T_SJ_XYRDataTable();
            var ad = new T_SJ_XYRTableAdapter();
            XYRDT = ad.GetXYRDataByBH(BH);
            return XYRDT;

        }

        public T_SJ_AJXXDataSet.T_ALLInfoDataTable GetXYRInfoByBH(decimal BH)
        {
            var XYRDT = new T_SJ_AJXXDataSet.T_ALLInfoDataTable();
            var ad = new T_ALLInfoTableAdapter();
            XYRDT = ad.GetXYRAYDataByBH(BH);
            return XYRDT;

        }

        public T_ZZ_AJXXDataSet.T_ZZ_AJXXDataTable GetZZData(string userName, string startDate,string endDate)
        {
            var ZZDT = new T_ZZ_AJXXDataSet.T_ZZ_AJXXDataTable();
            var ad = new T_ZZ_AJXXTableAdapter();
            ZZDT = ad.GetZZ_AJXXData(userName, startDate, endDate);
            return ZZDT;
        }

        public T_ZZ_AJXXDataSet.T_ZZ_AJXXDataTable GetZZDataByBH(decimal BH)
        {
            var ZZDT = new T_ZZ_AJXXDataSet.T_ZZ_AJXXDataTable();
            var ad = new T_ZZ_AJXXTableAdapter();
            ZZDT = ad.GetZZDataByBH(BH);
            return ZZDT;

        }

        public T_ZZ_AJXXDataSet.T_ZZ_BJBRDataTable GetBJBRDataByBH(decimal BH)
        {
            var ZZDT = new T_ZZ_AJXXDataSet.T_ZZ_BJBRDataTable();
            var ad = new T_ZZ_BJBRTableAdapter();
            ZZDT = ad.GetBJBRDataByBH(BH);
            return ZZDT;

        }
        public T_ZZ_AJXXDataSet.T_ZZ_JBRDataTable GetJBRDataByBH(decimal BH)
        {
            var ZZDT = new T_ZZ_AJXXDataSet.T_ZZ_JBRDataTable();
            var ad = new T_ZZ_JBRTableAdapter();
            ZZDT = ad.GetJBRDataByBH(BH);
            return ZZDT;

        }

        public T_ZZ_AJXXDataSet.T_ZZ_XYRDataTable GetZZ_XYRDataByBH(decimal BH)
        {
            var ZZDT = new T_ZZ_AJXXDataSet.T_ZZ_XYRDataTable();
            var ad = new T_ZZ_XYRTableAdapter();
            ZZDT = ad.GetXYRDataByBH(BH);
            return ZZDT;

        }


        public T_ZZ_AJXXDataSet.T_ZZ_ALLInfoDataTable GetZZAllInfoByBH(decimal BH)
        {
            var XYRDT = new T_ZZ_AJXXDataSet.T_ZZ_ALLInfoDataTable();
            var ad = new T_ZZ_ALLInfoTableAdapter();
            XYRDT = ad.GetALLData(BH);
            return XYRDT;

        }

        public T_MX_AJXXDataSet.T_MX_AJXXDataTable GetMX_AJXX(string userName, string startDate, string endDate)
        {
            var MXDT = new T_MX_AJXXDataSet.T_MX_AJXXDataTable();
            var ad = new T_MX_AJXXTableAdapter();
            MXDT = ad.GetMX_AJXXData(userName, startDate, endDate);
            return MXDT;

        }

        public T_MX_AJXXDataSet.T_MX_DSRDataTable GetMX_DSRByBH(decimal BH)
        {
            var MXDT = new T_MX_AJXXDataSet.T_MX_DSRDataTable();
            var ad = new T_MX_DSRTableAdapter();
            MXDT = ad.GetMX_DSRDataByBH(BH);
            return MXDT;

        }

        public T_MX_AJXXDataSet.T_MX_AJXXDataTable GetMXInfoByBH(decimal BH)
        {
            var MXDT = new T_MX_AJXXDataSet.T_MX_AJXXDataTable();
            var ad = new T_MX_AJXXTableAdapter();
            MXDT = ad.GetMXDataByBH(BH);
            return MXDT;

        }

        public T_MX_AJXXDataSet.T_MX_SSLYDataTable GetSSLYInfoByBH(decimal BH)
        {
            var MXDT = new T_MX_AJXXDataSet.T_MX_SSLYDataTable();
            var ad = new T_MX_SSLYTableAdapter();
            MXDT = ad.GetSSLYDataByBH(BH);
            return MXDT;

        }

        //Method to get the data in table T_DM
        public T_DMDataSet.T_DMDataTable GetDMByBXH(decimal BXH)
        {
            var DMDT = new T_DMDataSet.T_DMDataTable();
            var ad = new T_DMTableAdapter();
            DMDT = ad.GetDMDataByBXH(BXH);
            return DMDT;
        }

        public T_MX_AJXXDataSet.T_MX_DJXXDataTable GetDJXXInfoByBH(decimal BH)
        {
            var MXDT = new T_MX_AJXXDataSet.T_MX_DJXXDataTable();
            var ad = new T_MX_DJXXTableAdapter();
            MXDT = ad.GetDJXXDataByBH(BH);
            return MXDT;

        }

        public T_FJ_AJXXDataSet.T_FJ_AJXXDataTable GetFJAJXX(string userName, string startDate, string endDate)
        {
            var FJAJXXDT = new T_FJ_AJXXDataSet.T_FJ_AJXXDataTable();
            var ad = new T_FJ_AJXXTableAdapter();
            FJAJXXDT = ad.GetFJAJXXData(userName, startDate, endDate);
            return FJAJXXDT;

        }

        public T_FJ_AJXXDataSet.T_FJ_AJXXDataTable GetFJAJXXByBH(decimal BH)
        {
            var FJAJXXDT = new T_FJ_AJXXDataSet.T_FJ_AJXXDataTable();
            var ad = new T_FJ_AJXXTableAdapter();
            FJAJXXDT = ad.GetFJDataByBH(BH);
            return FJAJXXDT;
        }

        public T_FJ_AJXXDataSet.T_FJ_BJBRDataTable GetFJBJBRByBH(decimal BH)
        {
            var FJAJXXDT = new T_FJ_AJXXDataSet.T_FJ_BJBRDataTable();
            var ad = new T_FJ_BJBRTableAdapter();
            FJAJXXDT = ad.GetFJ_BJBRDataByBH(BH);
            return FJAJXXDT;
        }

        public T_FJ_AJXXDataSet.T_FJ_XYRDataTable GetFJXYRByBH(decimal BH)
        {
            var FJAJXXDT = new T_FJ_AJXXDataSet.T_FJ_XYRDataTable();
            var ad = new T_FJ_XYRTableAdapter();
            FJAJXXDT = ad.GetFJXYRDataByBH(BH);
            return FJAJXXDT;
        }

        public T_FJ_AJXXDataSet.T_FJ_ALLInfoDataTable GetFJAllInfoByBH(decimal BH)
        {
            var XYRDT = new T_FJ_AJXXDataSet.T_FJ_ALLInfoDataTable();
            var ad = new T_FJ_ALLInfoTableAdapter();
            XYRDT = ad.GetFJAllData(BH);
            return XYRDT;
        }


        public T_RMJDY_JDAJXXDataSet.T_RMJDY_SearchDataTable GetRMJDYData(string userName, string startDate,string endDate)
        {
            var ZZDT = new T_RMJDY_JDAJXXDataSet.T_RMJDY_SearchDataTable();
            var ad = new T_RMJDY_SearchTableAdapter();
            ZZDT = ad.GetRMJDYData(userName, startDate, endDate);
            return ZZDT;
        }
        public T_RMJDY_JDAJXXDataSet.T_RYXX20100322DataTable GetRYXXByRYByXM(string XM)
        {
            var RYXXDT = new T_RMJDY_JDAJXXDataSet.T_RYXX20100322DataTable();
            var ad = new JM.JCY.BusinessEntity.DSJCYD94.T_RMJDY_JDAJXXDataSetTableAdapters.T_RYXX20100322TableAdapter();
            RYXXDT = ad.GetRYXXDataByXM(XM);
            return RYXXDT;
        }
        
        public T_RMJDY_JDAJXXDataSet.T_RMJDY_JDAJXXDataTable GetRMJDYDataBH(decimal BH)
        {
            var RMJDYDT = new T_RMJDY_JDAJXXDataSet.T_RMJDY_JDAJXXDataTable();
            var ad = new T_RMJDY_JDAJXXTableAdapter();
            RMJDYDT = ad.GetRMJDYDataByBH(BH);
            return RMJDYDT;
        }

        public T_RMJDY_JDAJXXDataSet.T_RYXX20100322DataTable GetRYXXByRYBH(decimal RYBH)
        {
            var RYXXDT = new T_RMJDY_JDAJXXDataSet.T_RYXX20100322DataTable();
            var ad = new JM.JCY.BusinessEntity.DSJCYD94.T_RMJDY_JDAJXXDataSetTableAdapters.T_RYXX20100322TableAdapter();
            RYXXDT = ad.GetRYXXDataByRYBH(RYBH);
            return RYXXDT;
        }

        public T_RMJDY_JDAJXXDataSet.T_RMJDY_XYRXXDataTable GetRMJDY_XYRDataBH(decimal BH)
        {
            var RMJDYDT = new T_RMJDY_JDAJXXDataSet.T_RMJDY_XYRXXDataTable();
            var ad = new T_RMJDY_XYRXXTableAdapter();
            RMJDYDT = ad.GetRMJDY_XYRByBH(BH);
            return RMJDYDT;
        }


        public T_RMJDY_JDAJXXDataSet.T_RMJDY_ALLAYInfoDataTable GetRMJDY_XYRAYData(decimal BH)
        {
            var RMJDYDT = new T_RMJDY_JDAJXXDataSet.T_RMJDY_ALLAYInfoDataTable();
            var ad = new T_RMJDY_ALLAYInfoTableAdapter();
            RMJDYDT = ad.GetRMJDY_AYData(BH);
            return RMJDYDT;
        }

        public T_XSGL_JBXSXXDataSet.T_XSGLDataTable GetXSGLData(string  SAR,string StartDate,string EndDate)
        {
            var XSGLDT = new T_XSGL_JBXSXXDataSet.T_XSGLDataTable();
            var ad = new T_XSGLTableAdapter();
            XSGLDT = ad.GetXSGL_JBXData(SAR, StartDate, EndDate);
            return XSGLDT;
        }

        public T_XSGL_JBXSXXDataSet.T_XSGLDataTable GetXSGLDataByBH(decimal BH)
        {
            var XSGLDT = new T_XSGL_JBXSXXDataSet.T_XSGLDataTable();
            var ad = new T_XSGLTableAdapter();
            XSGLDT = ad.GetXSGLDataByBH(BH);
            return XSGLDT;
        }

        public T_XSGL_JBXSXXDataSet.T_XSGL_BJBRXXDataTable GetXSGL_BJBRByBH(decimal BH)
        {
            var XSGLDT = new T_XSGL_JBXSXXDataSet.T_XSGL_BJBRXXDataTable();
            var ad = new T_XSGL_BJBRXXTableAdapter();
            XSGLDT = ad.GetBJBRDataByBH(BH);
            return XSGLDT;
        }


        public T_XSGL_JBXSXXDataSet.T_RYXX20100322DataTable GetXSGL_RYXXByXM(string XM)
        {
            var XSGLDT = new T_XSGL_JBXSXXDataSet.T_RYXX20100322DataTable();
            var ad = new JM.JCY.BusinessEntity.DSJCYD94.T_XSGL_JBXSXXDataSetTableAdapters.T_RYXX20100322TableAdapter();
            XSGLDT = ad.GetRYXXDataByXM(XM);
            return XSGLDT;
        }


        public T_XSGL_JBXSXXDataSet.T_XSGL_JBCLQKDataTable GetXSGL_JBCLQKByBH(decimal BH)
        {
            var XSGLDT = new T_XSGL_JBXSXXDataSet.T_XSGL_JBCLQKDataTable();
            var ad = new T_XSGL_JBCLQKTableAdapter();
            XSGLDT = ad.GetJBCLQKDataByBH(BH);
            return XSGLDT;
        }

        //Method to get all the data in table T_DM
        public T_DMDataSet.T_DMDataTable GetDMData( )
        {
            var DMDT = new T_DMDataSet.T_DMDataTable();
            var ad = new T_DMTableAdapter();
            DMDT = ad.GetData();
            return DMDT;
        }

        public T_JDBDataSet.T_JDBSearchDataTable GetJDBData(string userName,string startData,string endData)
        {
            var JDBDT = new T_JDBDataSet.T_JDBSearchDataTable();
            var ad = new T_JDBSearchTableAdapter();
            JDBDT = ad.GetJDBData(userName, startData, endData);
            return JDBDT;
        }

        public T_JDBDataSet.T_JDBSearchDataTable GetJDBDataByBH(decimal BH)
        {
            var JDBDT = new T_JDBDataSet.T_JDBSearchDataTable();
            var ad = new T_JDBSearchTableAdapter();
            JDBDT = ad.GetJDBDataByBH(BH);
            return JDBDT;
        }

        public T_PB_AJXXDataSet.T_PB_AJXXDataTable GetPBData(string userName, string startDate,string endDate)
        {
            var PBDT = new T_PB_AJXXDataSet.T_PB_AJXXDataTable();
            var ad = new T_PB_AJXXTableAdapter();
            PBDT = ad.GetPBData(userName, startDate, endDate);
            return PBDT;
        }

        public T_PB_AJXXDataSet.T_PB_AJXXDataTable GetPBDataByBH(decimal BH)
        {
            var PBDT = new T_PB_AJXXDataSet.T_PB_AJXXDataTable();
            var ad = new T_PB_AJXXTableAdapter();
            PBDT = ad.GetPBDataByBH(BH);
            return PBDT;
        }
        public T_PB_AJXXDataSet.T_PB_XYRDataTable GetPBXYRByBH(decimal BH)
        {
            var PBXYRDT = new T_PB_AJXXDataSet.T_PB_XYRDataTable();
            var ad = new T_PB_XYRTableAdapter();
            PBXYRDT = ad.GetPBXYRDataByBH(BH);
            return PBXYRDT;
        }
        public T_PB_AJXXDataSet.T_PB_XYRAY_DMDataTable GetPBXYRAYByBH(decimal BH)
        {
            var AYDT = new T_PB_AJXXDataSet.T_PB_XYRAY_DMDataTable();
            var ad = new T_PB_XYRAY_DMTableAdapter();
            AYDT = ad.GetPBXYRAYData(BH);
            return AYDT;
        }

        public T_XSGL_JBXSXXDataSet.T_DWBZDDataTable GetDWBZDData(decimal id, decimal BH)
        {
            var DT = new T_XSGL_JBXSXXDataSet.T_DWBZDDataTable();
            var ad = new T_DWBZDTableAdapter();
            DT = ad.GetDWBZDData(id,BH);
            return DT;
        }

        public T_KS_JBXSXXDataSet.T_KS_SearchDataTable GetKSData(string userName, string startDate, string endDate)
        {
            var DT = new T_KS_JBXSXXDataSet.T_KS_SearchDataTable();
            var ad = new T_KS_SearchTableAdapter();
            DT = ad.GetKS_JBXSXXData(userName, startDate, endDate);
            return DT;
        }

        public T_KS_JBXSXXDataSet.T_KS_JBXSXXDataTable GetKSDataByBH(decimal BH)
        {
            var DT = new T_KS_JBXSXXDataSet.T_KS_JBXSXXDataTable();
            var ad = new T_KS_JBXSXXTableAdapter();
            DT = ad.GetKSDataByBH(BH);
            return DT;
        }


        public T_KS_JBXSXXDataSet.T_RYXX20100322DataTable GetKS_RYXXByRYBH(decimal RYBH)
        {
            var DT = new T_KS_JBXSXXDataSet.T_RYXX20100322DataTable();
            var ad = new JM.JCY.BusinessEntity.DSJCYD94.T_KS_JBXSXXDataSetTableAdapters.T_RYXX20100322TableAdapter();
            DT = ad.GetRYXXDataByRYBH(RYBH);
            return DT;
        }

        public T_KS_JBXSXXDataSet.T_KS_BJBRXXDataTable GetKS_BJBRDataByBH(decimal BH)
        {
            var DT = new T_KS_JBXSXXDataSet.T_KS_BJBRXXDataTable();
            var ad = new T_KS_BJBRXXTableAdapter();
            DT = ad.GetKS_BJBRDataByBH(BH);
            return DT;
        }

        public T_AJBSGXDataSet.T_AJBSGXDataTable GetAJBSGXDataByBH(decimal BH)
        {
            var DT = new T_AJBSGXDataSet.T_AJBSGXDataTable();
            var ad=new T_AJBSGXTableAdapter();
            DT=ad.GetAJBSGXDataByBH(BH);
            return DT;
        }
        public T_AJGL_AJJK_YJAJDataSet.T_AJGL_AJJK_YJAJDataTable GetTOPFive()
        {
            var DT = new T_AJGL_AJJK_YJAJDataSet.T_AJGL_AJJK_YJAJDataTable();
            var ad = new T_AJGL_AJJK_YJAJTableAdapter();
            DT = ad.GetTOPFive();
            return DT;
        }

        //预警案件
        public T_AJGL_AJJK_YJAJDataSet.T_AJGL_AJJK_YJAJDataTable GetAJGL_AJJK_YJAJ(string CBR, string CBBM, int KSRQ, int CQRQ, string startDate, string endDate)
        {
            var DT = new T_AJGL_AJJK_YJAJDataSet.T_AJGL_AJJK_YJAJDataTable();
            var ad = new T_AJGL_AJJK_YJAJTableAdapter();
            DT = ad.GetAJGL_AJJK_YJAJData(CBR, CBBM, KSRQ, CQRQ, startDate, endDate);
            return DT;
        }

        //更具承办人统计预警案件数量
        public int GetCaseWarningCountByCBR(string CBR)
        {
            var ad = new T_AJGL_AJJK_YJAJTableAdapter();
            return Int32.Parse(ad.GetCaseWarningCountByCBR(CBR).ToString());
             
        }

        //案件快速查询
        public T_AJGL_AJCXDataSet.T_AllDataDataTable GetAJGL_AJCX(string CBR, string CBBM, string startDate, string endDate,string N_AJLB)
        {
            var DT = new T_AJGL_AJCXDataSet.T_AllDataDataTable();
            var ad = new T_AllDataTableAdapter();
            DT = ad.GetAllData(CBR, CBBM, startDate, endDate, N_AJLB);
            return DT;
        }

        //部门案件
        public CaseManagementDataSet.T_AJGL_AJJK_BMAJDataTable GetDepartmentCase(string deptName)
        {
            var DT = new CaseManagementDataSet.T_AJGL_AJJK_BMAJDataTable();
            var ad = new T_AJGL_AJJK_BMAJTableAdapter();
            DT = ad.GetDataByDept(deptName);
            return DT;
        }
        //全流程案件
        public CaseManagementDataSet.T_AJGL_AJJK_QLCAJDataTable GetFullFlowCase(string AJJD)
        {
            var DT = new CaseManagementDataSet.T_AJGL_AJJK_QLCAJDataTable();
            var ad = new T_AJGL_AJJK_QLCAJTableAdapter();
            DT = ad.GetDataByAJJD(AJJD);
            return DT;
        }

        //重点监督案件
        public CaseManagementDataSet.T_AJGL_AJJK_ZJJDAJDataTable GetKeyPointCase()
        {
            var DT = new CaseManagementDataSet.T_AJGL_AJJK_ZJJDAJDataTable();
            var ad = new T_AJGL_AJJK_ZJJDAJTableAdapter();
            DT = ad.GetData();
            return DT;
        }



    }
}
